//
//  ShuangSeQiuDetailCell.m
//  K8彩票
//
//  Created by zyn on 2017/6/7.
//  Copyright © 2017年 zhoubo. All rights reserved.
//

#import "ShuangSeQiuDetailCell.h"

@implementation ShuangSeQiuDetailCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setContentShuangSeQiu:(CaipiaoHistoryModel *)model{
    
    _labelQiHao.text = [NSString stringWithFormat:@"第%@期",model.issueno];
    NSArray *arrs = [model.number componentsSeparatedByString:@" "];
    _label1.text = arrs[0];
    _label2.text = arrs[1];
    _label3.text = arrs[2];
    _label4.text = arrs[3];
    _label5.text = arrs[4];
    _label6.text = arrs[5];
    _label7.text = model.refernumber;
    
    [_label6 setBackgroundColor:[self rgba_16:@"FE3C3C"]];
}

-(void)setContentDaLeTou:(CaipiaoHistoryModel *)model{
    _labelQiHao.text = [NSString stringWithFormat:@"第%@期",model.issueno];
    NSArray *arrs = [model.number componentsSeparatedByString:@" "];
    NSArray *arrsBlue = [model.refernumber componentsSeparatedByString:@" "];
    _label1.text = arrs[0];
    _label2.text = arrs[1];
    _label3.text = arrs[2];
    _label4.text = arrs[3];
    _label5.text = arrs[4];
    _label6.text = arrsBlue[0];
    _label7.text = arrsBlue[1];
    
    [_label6 setBackgroundColor:[self rgba_16:@"0000FF"]];
}

-(UIColor *)rgba_16:(NSString *)colorString{
    NSInteger red = strtoul([[colorString substringWithRange:NSMakeRange(0, 2)] UTF8String],0,16);
    NSInteger green = strtoul([[colorString substringWithRange:NSMakeRange(2, 2)] UTF8String],0,16);
    NSInteger blue = strtoul([[colorString substringWithRange:NSMakeRange(4, 2)] UTF8String],0,16);
    
    return [UIColor colorWithRed:red/255.0 green:green/255.0 blue:blue/255.0 alpha:1];
}

@end
